/**
 * Created by Administrator on 2017/12/20/020.
 */

$(document).ready(function () {

    var isCartPopHover = false;
    var isDownloadAppHover = false;

    $(".search-input").focus(function () {
        $(".search-line").css('background-color', 'red');
        $(".flag").css('display', 'none');
        $(".flag-two").css('display', 'none');
    })

    $('.search-input').blur(function () {
        $(".search-line").css('background-color', 'lightgrey');
        $(".flag").css('display', 'inline');
        $(".flag-two").css('display', 'inline');
    })

    $('.my-cart').hover(function () {
        $('.img-cart').attr('src', 'img/gouwuche_red.png');
        $('.cart-pop').css('display', 'block');
    }, function () {
        var timer = window.setTimeout(function () {
            if (!isCartPopHover) {
                $('.img-cart').attr('src', 'img/gouwuche.png');
                $('.cart-pop').css('display', 'none');
            }
        }, 100);
    });

    $('.cart-pop').hover(function () {
        isCartPopHover = true;
    }, function () {
        isCartPopHover = false;
        $('.cart-pop').css('display', 'none');
    });

    $('.span-download-app').hover(function () {
        $('.download-pop').css('display', 'block');
    }, function () {
        var timerDownload = window.setTimeout(function () {
            if (!isDownloadAppHover) {
                $('.download-pop').css('display', 'none');
            }
        }, 100);

    });

    $('.download-pop').hover(function () {
        isDownloadAppHover = true;
    }, function () {
        isDownloadAppHover = false;
        $('.download-pop').css('display', 'none');
    });

    $('.content-main-left li').hover(function () {
        $('.content-main-select-show').css('display', 'block');
    }, function () {
        $('.content-main-select-show').css('display', 'none');
    });

});